"""
selenium使用js处理不可见元素
"""
import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://element.eleme.cn/#/zh-CN/component/form")
driver.maximize_window()
# js处理不可见元素
element = driver.find_element(By.XPATH,
                              '//*[@id="app"]/div[2]/div/div[1]/div/div/div[2]/section/div[1]/div[1]/div/form/div[6]/div/div/label[1]/span[1]/span')
driver.execute_script('arguments[0].click();', element)
time.sleep(3)

driver.close()
